//
// Created by user on 2022/1/12.
//
#include <iostream>
#include <vector>

using namespace std;
vector<int> findDisappearedNumbers(vector<int>& nums) {
    int n = nums.size();

    vector<int> res;
    for (unsigned int i = 0; i < n; i++) {
        int index = (nums[i]-1)%n;
        nums[index] += n;
    }
    for (int i = 0; i < n; ++i) {
        if(nums[i]<=n)res.push_back(i+1);
    }
    return res;

}

int main() {

//   std::cout << "Hello, World!" << std::endl;
    vector<int> nums= {4,3,2,7,8,2,3,1};
    vector<int> res = findDisappearedNumbers(nums);
    for (int n: res){
        cout << n << endl;
    }



    return 0;
}
